<!doctype html>
{% load static %}
<html lang="zh">
<head>
    <title>忘记密码</title>
    <meta http-equiv="Content-Tyuserspe" content="text/html; charset=utf-8" />
    <link href="{% static 'css/style2.css' %}" rel='stylesheet' type='text/css' />
	<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
    <!-- js -->
    <style>
         #veremailButtom {
            font-size: 1em;
            color: #fff;
            background: #2dde98;
            outline: none;
            border: none;
            cursor: pointer;
            padding: 15px 10px;
            -webkit-appearance: none;
            width: 100%;
            font-weight: 400;
            transition: .5s all;
            -webkit-transition: .5s all;
            -moz-transition: .5s all;
            -o-transition: .5s all;
            -ms-transition: .5s all;
            text-transform: uppercase;
            margin-top: 1.3em;
            font-family: 'Rationale', sans-serif;
        }
         #veremailButtom:hover{
            font-size: 1em;
            color: #fff;
            background: #f2545f;
            outline: none;
            border: none;
            cursor: pointer;
            padding: 15px 10px;
            -webkit-appearance: none;
            width: 100%;
            font-weight: 400;
            transition: .5s all;
            -webkit-transition: .5s all;
            -moz-transition: .5s all;
            -o-transition: .5s all;
            -ms-transition: .5s all;
            text-transform: uppercase;
            margin-top: 1.3em;
            font-family: 'Rationale', sans-serif;
        }
    </style>
    <script>window.jQuery || document.write('<script src="{% static 'js/jquery-2.1.1.min.js' %}"><\/script>')</script>
    <script src="{% static 'js/vidbg.js' %}"></script>
    <script type="text/javascript">
        jQuery(function($){
            $('body').vidbg({
                 'mp4': '{% static "images/mp4.mp4" %}',
            }, {
                // Options
                muted: true,
                loop: true,
                overlay: true,
            });
        });

        $(document).ready(function(){
                $(".veremailButtom").click(function(){
                    var username = $("#id_username").val();
                    var email = $("#id_email").val();
                    $.ajax({
                        type:"POST",
                        data:{'username':username,'email':email},
                        url:"{% url 'users:forgetemail' %}",
                        success:function (data) {
                            console.log(data)
                            if (data["st"] == 1) {
                                alert("请前往邮箱进行验证")
                            }
                        },
                        error: function () {
                            alert("发送失败");
                        }
                    })
                })
        })

    </script>
</head>
<body>
<div class="contain">
<h1><a href="{% url 'index' %}"style="color:white">DragonStack Cloud</a></h1>
<div class="main">


    <div class="login-top left">
        <div class="social_icons">
            <div class="w3-signup-head-top">
                <h3>密码找回</h3>
            </div>

        </div>
         <form>
            <input type="text" id="id_username"  name="username" class="name" placeholder="用户名" required=""/>
            <input type="text" id="id_email" name="email" class="email validate[required,custom[email]" placeholder="邮箱地址" required=""/>
            <input type="button" class="veremailButtom" id="veremailButtom" value="验证邮箱"/>
        </form>
        <div class="clear"></div>
    </div>
     <div class="w3-bottom-text">
            <h3><a href="{% url 'users:login' %}">返回登录页面</a></h3>
            <h4><a href="{% url 'users:regist' %}">注册</a></h4>
     </div>

</div>
<div class="clear"></div>
<div class="copy-right w3l-agile logbotom">
    <p>Copyright © 2017 Provincial Key Laboratory of Network and System Security, Xidian University, Shaanxi Province, China.</p>
</div>

</div>
</body>
</html>